<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.

<html>
    <head>
        <title>登录页面</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.js"></script>
        <script type="text/javascript">
            function login() {
                var user=$("#user").val();
                var pwd=$("#pwd").val();
                $.post("/forum/index.php/user/login/login",{"user":user,"pwd":pwd},function (data) {
                    if(data==="success"){
                        alert("登录成功！");
                        window.history.go(-1);
                    } else {
                        alert("用户名或密码错误！");
                    }
                })
            }
        </script>
    </head>
    <body>
            用户名：<input type="text" id="user">
            <br><br>
            密码：<input type="password" id="pwd">
            <br><br>
            <button onclick="login()">登录</button>
    </body>
</html>
-->
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>登录页面</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <script src="/forum/public/static/js/jquery1.8.3/jquery.min.js"></script>
    <link rel="alternate icon" type="image/png" href="/forum/public/static/assets/i/favicon.png">
    <link rel="stylesheet" href="/forum/public/static/assets/css/amazeui.min.css"/>
    <style>
        .header {
            text-align: center;
        }
        .header h1 {
            font-size: 200%;
            color: #333;
            margin-top: 30px;
        }
        .header p {
            font-size: 14px;
        }
    </style>
    <script type="text/javascript">
        function login() {
            var user=$("#user").val();
            var pwd=$("#pwd").val();
            $.post("/forum/index.php/user/login/login",{"user":user,"pwd":pwd},function (data) {
                if(data==="success"){
                    window.history.go(-1);
                } else {
                    $("#login_error").empty();
                    $("#login_error").append(" <label class='am-form-label' for='doc-ipt-error'>帐号或密码错误！</label>")
                }
            })
        }
        function register() {
            window.location.href='/forum/index.php/user/register'
        }
    </script>
</head>
<body>
<div class="header">
    <div class="am-g">
        <h1>PHP测试论坛</h1>
    </div>
    <hr />
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <br>
        <br>
        <form class="am-form">
            <label for="user">帐号:</label>
            <input type="text" name="" id="user">
            <br>
            <label for="pwd">密码:</label>
            <input type="password" name="" id="pwd" class="am_form_field">
            <div class="am-form-group am-form-error" style="margin-top: 20px" id="login_error">
            </div>
        </form>
            <br>
            <label for="remember-me">
                <input id="remember-me" type="checkbox">
                记住密码
            </label>
            <br />
        <div class="am-cf">
            <input type="submit" name="" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl" onclick="login()">
            <input type="submit" name="" value="注册帐号" class="am-btn am-btn-default am-btn-sm am-fr" onclick="register()">
            <input type="submit" name="" value="忘记密码 ^_^? " class="am-btn am-btn-default am-btn-sm am-fr">

        </div>
        <hr>
        <p>© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </div>
</div>
</body>
</html>

